package jwlee.testrmi;

import java.rmi.*;
import java.rmi.server.*;

public class RmiHelloClient {

	public RmiHelloClient() {
	}

	public static void main(String[] args) {
		// 创建并安装安全管理器
		if (System.getSecurityManager() == null) {
			System.setSecurityManager(new RMISecurityManager());
		}

		try {
			RmiHelloRemoteInterface ri = (RmiHelloRemoteInterface) Naming
					.lookup("rmi://10.13.0.24:7777/RmiHelloServer");
			System.out.println(ri.helloRemoteObj("mzj"));
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.exit(0);
	}
}